package com.zsy.controller;

import com.zsy.pojo.OperateLog;
import com.zsy.pojo.PageResult;
import com.zsy.pojo.Result;
import com.zsy.service.LogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: zhengsuyang
 * @Desc:
 * @create: 2025-09-14 19:36
 **/
@RestController
@Slf4j
public class LogController {
    @Autowired
    private LogService logService;

    /**
     *获取操作日志列表
     * @param page
     * @param pageSize
     * @return
     */
    @GetMapping("/log/page")
    public Result getLogPage(@RequestParam(name = "page",defaultValue = "1") Integer page,
                             @RequestParam(name = "pageSize",defaultValue = "10") Integer pageSize){
        PageResult<OperateLog> pageResult = logService.getLogPage(page,pageSize);
        return Result.success(pageResult);
    }
}
